﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace BSChuangXu.API.Read.DTO
{
    /// <summary>
    /// 用户dto
    /// </summary>
    public class UserDto
    {
        /// <summary>
        /// 用户主键
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// 部门Id
        /// </summary>
        public int DepId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string? UserName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string? Password { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        public string? NickName { get; set; }

        /// <summary>
        /// 性别 false 男 true 女
        /// </summary>
        public bool Sex { get; set; }

        /// <summary>
        /// 省份id
        /// </summary>
        public int ProvinceId { get; set; }
        /// <summary>
        /// 市id
        /// </summary>
        public int CityId { get; set; }

        /// <summary>
        /// 县id
        /// </summary>
        public int CountyId { get; set; }

        /// <summary>
        /// 村详细地址
        /// </summary>
        public string HamletName { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreateName { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; } = DateTime.Now;
        [NotMapped]
        public string Createtimes { get { return CreateTime.ToString("yyyy-MM-dd"); } }
        /// <summary>
        /// 修改人
        /// </summary>
        public string? UpdateName { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime UpdateTime { get; set; }
        /// <summary>
        /// 用户角色关系id
        /// </summary>
        public int UserRoleId { get; set; }
        /// <summary>
        /// 角色ID
        /// </summary>
        public int RoleId { get; set; }
        /// <summary>
        /// 角色名称
        /// </summary>
        public string? RoleName { get; set; }

        /// <summary>
        /// 逻辑删除 false 未删  true 删除
        /// </summary>
        public bool IsDel { get; set; }
    }
}
